package com.zyt.state;

import com.zyt.state.solution_flow.MarioStateMachineOne;
import com.zyt.state.solution_table_lookup.MarioStateMachineTwo;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        testSolution1();
        testSolution2();
    }

    public static void testSolution1() {
        State state = State.SMALL;
        MarioStateMachineOne machine = new MarioStateMachineOne(state);
        System.out.println("Mario is " + machine.getCurrentState() + "; score is " + machine.getScore());
        machine.obtainMushRoom();
        System.out.println("Mario is " + machine.getCurrentState() + "; score is " + machine.getScore());

        machine.obtainFlower();
        System.out.println("Mario is " + machine.getCurrentState() + "; score is " + machine.getScore());
    }

    public static void testSolution2() {
        State state = State.SMALL;
        MarioStateMachineTwo machine = new MarioStateMachineTwo(state);
        System.out.println("Mario is " + machine.getCurrentState() + "; score is " + machine.getScore());
        machine.obtainMushRoom();
        System.out.println("Mario is " + machine.getCurrentState() + "; score is " + machine.getScore());

        machine.obtainFlower();
        System.out.println("Mario is " + machine.getCurrentState() + "; score is " + machine.getScore());
    }
}
